package com.cll.pmis.entity;

import com.cll.pmis.common.validator.group.Insert;
import io.github.llchen.apidoc.annotation.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(description = "开药表")
public class Prescribe implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;
    /**
     * 药品id
     */
    @NotNull(message = "药品id不能为空",groups = {Insert.class})
    private Integer drugId;
    /**
     * 订单id
     */
    private Integer orderId;
    /**
     * 剂量
     */
    @NotBlank(message = "剂量不能为空",groups = {Insert.class})
    private String dosage;
    /**
     * 使用方法
     */
    @NotBlank(message = "使用方法不能为空",groups = {Insert.class})
    private String usage;
    /**
     * 频次
     */
    @NotBlank(message = "频次不能为空，单位：x/天",groups = {Insert.class})
    private String frequency;
    /**
     * 服用天数
     */
    @NotNull(message = "服用天数不能为空",groups = {Insert.class})
    @Min(value = 1L,message = "服用天数至少为1",groups = {Insert.class})
    private Integer days;
    /**
     * 数量
     */
    @NotNull(message = "药品数量不能为空",groups = {Insert.class})
    @Min(value = 1L,message = "数量至少为1",groups = {Insert.class})
    private Integer num;
    /**
     * 说明
     */
    private String description;
    /**
     * 取药地点
     */
    private String address="本院";
    /**
     * 状态，0->代收费，1->已收费
     */
    private Integer status;
    private Date createTime;


}
